`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date:    11:17:03 02/28/2014 
// Design Name: 
// Module Name:    BCD_convert 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//////////////////////////////////////////////////////////////////////////////////
module BCD_convert(binary, TThs, Ths, Hds, Tens, Ones);

	// takes in a 16 bit binary number, 
	// outputs the decimal digits seperately
	
	input [15:0] binary;   
	output reg [3:0] TThs, Ths, Hds, Tens, Ones;

		// Operations:
	
	always @ (binary)
		begin
	TThs <= binary/(16'd 10000);
	Ths <= (binary%(16'd 10000))/(16'd 1000);
	Hds <= (binary%(16'd 1000))/(16'd 100);
	Tens <= (binary%(16'd 100))/(16'd 10);
	Ones <= (binary%(16'd 10));
		end
		
endmodule
